import RoomItem from '@/components/room-item/index'
import classNames from 'classnames'
import PropTypes from 'prop-types'
import React, { memo } from 'react'
import { useState } from 'react'
import { useEffect } from 'react'

import RoomsWarrper from './style'

const index = memo((props) => {
  const {listData} = props
  const [show,changShow] = useState(true)
  useEffect(()=>{
    changShow(false)
  },[listData])
  return (
    <RoomsWarrper>
      {
        show && <div className={classNames("cover")}></div>
      }
        <ul>
        {
          listData?.map((n,i)=>{
            return <RoomItem show={false} itemData={n} key={i} itemWidth="20"></RoomItem>
          })
        }
        </ul>
    </RoomsWarrper>
  )
})

index.propTypes = {
  listData:PropTypes.array
}

export default index